<?php 
	namespace app\admin\controller;
	use think\Controller;
	use think\Session;
	use think\Db;


	//客服端
	class Client extends Allow
	{
        //数据提交页面
		public function getIndex()
		{
            //加载添加页面
			return $this->fetch('client/add');
		}
        
        //执行添加数据
		public function postClient($paliass,$errnums)
		{

			client($paliass,$errnums);


            //查询设置表中最新数据
            $set=Db::table('set')->order('sid desc')->limit(1)->find();
            //获取手机号数据
            $nnum=$set['notifyphone'];
            //调用发送短信功能
            sendNote($nnum);
            //调用发送邮件功能
            $notifymail=$set['notifymail'];
            $mail=explode(',',$notifymail);
            $pname=$data['pname'];
            $title="您所管理的".$pname.'发生了以下错误';
            $errnum=$data['errnum'];
            $econtent=$data['econtent'];
            $content="【错误编码:".$errnum."】\n错误描述：".$econtent;
            foreach ($mail as $key => $to){
                sendMail($to,$title,$content);
            }

		}

	}
 ?>